import parole
from parole.colornames import colors
from parole.display import interpolateRGB
import pygame, random

import sim, main
from util import *
from dungeon import makeFloor, Room, TemplateRoom
import dungeon

template = \
"""
###################
#     ##   ##     #
#    ##     ##    #
#    #       #    #
#  ##  o   o  ##  #
# ##     *     ## #
###    o H o    ###
##-------+-------##
#                 #
                   
                   
#  N  N  N  N  N  #
##               ##
### N  o   o N  ###
# ##           ## #
#  ##    N    ##  #
#    #       #    #
#    ##  N  ##    #
#     ##   ##     #
######### #########
"""[1:]

legend = {
    '.':    parole.map.MapObjectGenerator("", 
            lambda: sim.Obj('caked and flaking blood smears', 10,
                parole.map.AsciiTile('.',
                colors['Red'], bg_rgb=colors['DarkRed']),
                blockMove=False, massNoun=True, startsVowel=False),
            clearFirst=False),

    'o':    parole.map.MapObjectGenerator("", 
            lambda: sim.Obj('obsidian pillar', 100,
                parole.map.AsciiTile('o',
                colors['Black'], bg_rgb=None),
                blockMove=True, blockLOS=True, massNoun=False, startsVowel=True),
            clearFirst=False),

    '-':    parole.map.MapObjectGenerator("", 
            lambda: sim.Obj('opaque screen', 100,
                parole.map.AsciiTile('-',
                colors['Black'], bg_rgb=None),
                blockMove=True, blockLOS=True, massNoun=False, startsVowel=True),
            clearFirst=False),

    '+':    parole.map.MapObjectGenerator("", 
            lambda: sim.Door('solid pitchblende door', 100,
                parole.map.AsciiTile('/', colors['Black']),
                parole.map.AsciiTile('+', colors['Black']))),

    'N':    dungeon.thingGenerator('monsters', 'spawn'),
    'H':    dungeon.thingGenerator('monsters', 'haunter'),

    '*':    dungeon.thingGenerator('monsters', 'trapezohedron'),


    '#':    dungeon.rockGenerator(colors['Black'], name='obsidian wall',
        startsVowel=True),
}

floorColor1 = colors['White']
floorColor2 = colors['Black']
floorName = 'polished obsidian floor'
mixture = 0.8

#diggable = [
#    (4,0), 
#    (4,6),
#    (0,3),
#    (7,3),
#]
diggable = None # means perimeter

class MessHall(TemplateRoom):
    def __init__(self, pos):
        TemplateRoom.__init__(self, template, legend, diggable, pos,
                floorColor1, floorColor2, mixture, floorName)


roomClass = MessHall

